﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;
using System.Activities;
using System.Collections.ObjectModel;

namespace YasharEl.Infrastructure.ProcessEngine.DomainModel.WorkflowManagement
{
    [ContractClass(typeof(WorkflowActivityFinderContract))]
    public interface IWorkflowActivityFinder
    {
        Activity FindWorkflowProgram(string workflowXaml, out IDictionary<string, DynamicActivityProperty> inputs);
    }

    [ContractClassFor(typeof(IWorkflowActivityFinder))]
    internal abstract class WorkflowActivityFinderContract : IWorkflowActivityFinder
    {
        public Activity FindWorkflowProgram(string workflowXaml, out IDictionary<string, DynamicActivityProperty> inputs)
        {
            Contract.Requires<ArgumentNullException>(!string.IsNullOrWhiteSpace(workflowXaml), "workflowXaml could not be null or empty.");

            inputs = new Dictionary<string, DynamicActivityProperty>();
            return default(Activity);
        }
    }
}
